//
//  MyHttp.h
//  BlockDemo3
//
//  Created by mobao on 16/4/14.
//  Copyright © 2016年 mobao. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>
#import <SVProgressHUD.h>

@interface MyHttp : AFHTTPSessionManager

+(instancetype)sharedClient;

//获取当前网络状态
-(void)networkStateMonitoring:(void(^)(AFNetworkReachabilityStatus status))networkStateMonitoringBlock;

//GET 可决定是否带指示器
-(NSURLSessionDataTask*)GET:(NSString*)URLString
                 parameters:(id)parameters
                    success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                    failure:(void(^)(NSURLSessionDataTask *task, NSError * error))failure
                    showHUD:(BOOL)showHud;

//POST 可决定是否带指示器
-(NSURLSessionDataTask*)POST:(NSString *)URLString
                  parameters:(id)parameters
                     success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                     failure:(void (^)(NSURLSessionDataTask * task, NSError *error))failure
                     showHUD:(BOOL)showHud;


//GET 带指示器
-(NSURLSessionDataTask*)GET:(NSString*)URLString
                 parameters:(id)parameters
                    success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                    failure:(void(^)(NSURLSessionDataTask *task, NSError *error))failure;
//POST 带指示器
-(NSURLSessionDataTask*)POST:(NSString *)URLString
                  parameters:(id)parameters
                     success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                     failure:(void (^)(NSURLSessionDataTask * task, NSError *error))failure;

@end
